Replication archive instructions

Blair, Imai, and Zhou. Forthcoming. "Design and Analysis of the Randomized Response Technique.” Journal of the American Statistical Association.

This replication archive replicates statistical analyses presented in the paper using Knitr, which produces a PDF from the file randresp.Rnw, and the packrat library in R that ensures the exact version of R packages are used.

To replicate the paper and create the PDF that includes the results:

1. Unzip the file packrat.zip into a folder called “packrat” in the same directory as knit.R and randresp.Rnw.

2. Open R (may require using R version 3.1.3, which was used by the authors).

3. Run the command
	source("knit.R")

This should take some time, but will generate a tex file, randresp.tex, and also compile it into a PDF.

If you have trouble using packrat, you can install each package from source by installing the .tar.gz files in the packrat/src folder manually. 

You can also comment out the line “source("packrat/init.R”)” in knit.R to disable using packrat. This will allow you to compile a PDF of the file, but it may not replicate results exactly due to differences in R package versions from your computer and those used by the authors originally.

NOTE: There may be small differences across platforms in the empirical results, even with the same version of R and R packages. The file was originally produced on a Mac, with OS X Yosemite (10.10.3).
